package pta;/**
 * @author： li
 * @date： 2022-03-28 16:55
 * @version 1.0
 */
import java.util.*;
public class 求整数段和 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a =sc.nextInt();
        int b =sc.nextInt();
        int sum=0;int count=0;
        int nums = (b-a+1);
        for(int i=a;i<=b;i++){
            sum+=i;
            count++;
            for(int j=1;j<=5-String.valueOf(i).length();j++)
                System.out.print(" ");
            System.out.print(i);
            if(count==5){
                System.out.println();
                count=0;
            }
            if(count<5&&i==b&&!(nums%5==0))
                System.out.println();
        }
        System.out.println("Sum = "+sum);
    }
}
